﻿using System;
using System.Linq;
using System.Data;
namespace LayerEntity.Almacen
{
    public class EAlmacen : Sistema.ESistema
    {
        public EAlmacen()
        {
            this.op = 0;
            this.Id_Almacen = 0;
            this.Des_almacen = string.Empty;
            this.Ubigeo = string.Empty;
            this.Direccion = string.Empty;
            this.Id_Estado = 0;
            this.Id_Persona = string.Empty;
            this.Id_Sucursal = 0;
            this.IdUsuario = string.Empty;
            this.Is_Principal = 0;
        }

        public EAlmacen(IDataRecord record) {
           
            this.Id_Almacen = (int)record["id_almacen"];
            this.Des_almacen = record["des_almacen"].ToString();
            this.Id_Estado = (int)record["id_estado"];
            this.Id_Sucursal = (int)record["id_hotel"];
            this.Direccion = record["direccion"].ToString();
            this.Ubigeo = record["ubigeo"].ToString();
            this.Is_Principal = (int)record["is_principal"];

        }
        public object[] ToObject(int operacion)
        {
            object[] obj = new object[]
            {
                operacion,
                this.Id_Almacen,
                this.Des_almacen,
                this.Ubigeo,
                this.Direccion,
                this.Id_Estado,
                this.Id_Persona,
                this.Id_Sucursal,
                this.IdUsuario,
                this.Is_Principal
            };
            return obj;
        }

        public string Des_almacen { get; set; }
        public string Direccion { get; set; }
    }
}